chore: autoGolf proof bodies across 61 files (−841 lines)#16
Closed
cameronfreer wants to merge 6 commits into
Closed
chore: autoGolf proof bodies across 61 files (−841 lines)#16cameronfreer wants to merge 6 commits into
cameronfreer wants to merge 6 commits into
Conversation
Automated golfing via autoGolf.lean --preset power --min-line-reduction 2: - Collapse multi-step proofs to direct lemma applications - Replace verbose `have` chains with term-mode proofs - Compress `by exact` to direct terms - Notable: KoopmanCommutation −47 lines, L2Helpers −38 lines, Core −21 lines Net: 22 files changed, ~70 insertions, ~305 deletions
Notable: BlockAverages −62 lines (17 suggestions, 14.6% heartbeat reduction), AlphaConvergence −49 lines, AlphaIicCE −19 lines, BlockAvgDef −9 lines
CesaroConvergence −108 lines (15 suggestions), FutureRectangles −23, FiniteProduct −21, MoreL2Helpers −43, DirectingMeasureIntegral −37, ViaMartingale −12, CondExpConvergence −11, PairLawEquality −8
Ergodic: InvariantSigma −19, KoopmanMeanErgodic −12, BirkhoffAvgCLM −8 Util: ProductBounds −2, StrictMono −3
CylinderHelpers −11, ShiftInvariantMeasure −13, TailSigma −9, CondExpShiftInvariance −6
…rgodic (batch 6) Probability: CondExpExtras −211 lines, Extension −28, CondExp −12, Projection −8, Convergence −6, Indicator −5, plus smaller changes. Reverts invalid autoGolf suggestions in KoopmanMeanErgodic.lean.
This was referenced May 18, 2026
cameronfreer
added a commit
that referenced
this pull request
May 18, 2026
KernelBridge.lean defines a local `Kernel.IndepFun.comp` lemma that duplicates mathlib's `ProbabilityTheory.Kernel.IndepFun.comp` (specialized to ℝ-valued composition targets). It has zero callers in the codebase: the `_indep.comp` calls in `Probability/CondIndep/Indicator.lean` and `Probability/CondIndep/Basic.lean` are on plain `IndepFun` (measure-based), which resolves to mathlib's `ProbabilityTheory.IndepFun.comp` — a different lemma in a different namespace. This delete is stronger than PR #16's autoGolf suggestion (which kept the lemma as a thin wrapper). Since there is nothing to wrap to, removing it outright is cleaner. - Exchangeability/DeFinetti/ViaKoopman/KernelBridge.lean: - delete the 30-line proof + 10-line docstring (lines 181-219) - update the module docstring "Main results" bullet list to match
cameronfreer
added a commit
that referenced
this pull request
May 18, 2026
) Mines safe-subset replacements from the PR #16 autoGolf draft and applies them to current main, skipping the suspicious subset (lia / bare assumption / Real.ext_cauchy / grind only on non-arithmetic goals). `fun_prop` adoptions (replace hand-built `Measurable.const_mul + Finset.measurable_sum + .comp` chains): - `DeFinetti/ViaKoopman/BlockAverage.lean` (1 site) - `DeFinetti/ViaL2/BlockAvgDef.lean` (1 site) - `DeFinetti/ViaL2/AlphaConvergence.lean` (2 sites) - `DeFinetti/ViaL2/CesaroConvergence.lean` (3 sites) - `DeFinetti/ViaL2/DirectingMeasureIntegral.lean` (4 sites, incl. one Integrable wrap via `fun_prop`) - `DeFinetti/ViaL2/MainConvergence.lean` (1 site) - `DeFinetti/ViaMartingale/PairLawEquality.lean` (1 site, `measurable_consRV` → fun_prop) - `Ergodic/ShiftInvariantRepresentatives.lean` (1 site, `measurable_coe_real_ereal.comp …` → fun_prop) - `Core.lean:683` — collapse `simpa using (show … from by fun_prop)` to bare `fun_prop`. Named-lemma replacements: - `DeFinetti/ViaL2/DirectingMeasureIntegral.lean` 2× hand-built `IsPiSystem` proof for `Set.range Iic` → `isPiSystem_Iic`. - `Contractability.lean:perm_range_eq` — 4-line `ext`+`use`+`simp` → `Finset.image_univ_equiv σ`. Minor `by exact` removals in `BlockAvgDef.lean`. Out of scope (per the audit, suspicious-category from #16): - `BlockAverage.lean:82` `congr 1; ring` → `lia` swap (opaque substitution on non-arithmetic context). - The proof-golfing-branch reversion of #18's `exists_perm_extending_strictMono` refactor. Net -62 lines across 10 files. Build clean (3527 jobs), axioms standard, 0 sorries. No statement or signature changes.
cameronfreer
added a commit
that referenced
this pull request
May 25, 2026
…Info (#112) Eight LSP-verified proof-body shrinks in the files that the bulk autoGolf run in PR #16 never reached. Each site was probed individually rather than via `exact?` (which timed out on these measure-heavy goals). * `Crossings/Pathwise.lean:54` `up_neg_flip_eq_down`: body collapses to `rfl` — `downcrossingsBefore` is definitionally `upcrossingsBefore (-b) (-a) (negProcess X)`, so both sides of the lemma unfold to the same `⨆ N, ...` term. * `Crossings/Pathwise.lean:123` `upcrossingsBefore_congr`: four lines (`simp only`/`congr`/`ext`/`rw`) collapse to `simp [upcrossingsBefore, upperCrossingTime_congr h]`. * `Reverse.lean:80` `revCEFinite_martingale`: inline the local `have : 𝔽 (N-i) ≤ 𝔽 (N-j)` into the final `condExp_condExp_of_le` call. * `Crossings/Bounds.lean:45` `hL1_bdd`: drop the `simp only [revCEFinite]`; `eLpNorm_one_condExp_le_eLpNorm` unifies definitionally. * `Crossings/AntitoneLimit.lean:350` `h_tower`: rewrite as a term-mode `fun n => condExp_condExp_of_le (iInf_le 𝔽 n) (h_le n)`. * `Crossings/AntitoneLimit.lean:368` `hL1_conv_Xn`: six-line `have`/`simp_rw`/`exact` collapses to a single `simpa [hXn_def, eLpNorm_sub_comm] using hL1_conv`. * `TripleLawDropInfo/PairLawHelpers.lean:40` `marginal_law_eq_of_pair_law`: five lines (two `have`s + final `rw`) become a single `simpa [Measure.map_map …] using congrArg (Measure.map Prod.snd) h_law`. * `TripleLawDropInfo/DropInfo.lean:211` final square-zero step: the trailing `have : ... = 0; linarith` two-liner collapses to a single `nlinarith [sq_nonneg (μ₂ ω - μ₁ ω)]`. Net: 6 files, +11 / −30 (−19 lines).
Merged
5 tasks
Owner
Author
|
Closing as stale + conflicting. The valuable golf from this branch has been cherry-picked into focused, LSP-verified PRs that landed cleanly on top of main:
The remaining diff vs. current main is mostly stale conflicts with no remaining unique value worth rebasing through. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Automated proof golfing via
autoGolf.lean --preset power --min-line-reduction 2 --compress-by-exact --inplace, applied across the entireExchangeability/tree.What changed
havechains into direct lemma applicationsby exact <term>to just<term>Biggest wins
Probability/CondExpExtras.leanDeFinetti/ViaL2/CesaroConvergence.leanDeFinetti/ViaL2/BlockAverages.leanDeFinetti/ViaL2/AlphaConvergence.leanDeFinetti/ViaKoopman/KoopmanCommutation.leanDeFinetti/ViaL2/MoreL2Helpers.leanDeFinetti/L2Helpers.leanDeFinetti/ViaL2/DirectingMeasureIntegral.leanProbability/CondIndep/Bounded/Extension.leanDeFinetti/ViaMartingale/FutureRectangles.leanCommits (6 batches)
3a800187— Core, Contractability, DeFinetti top-level, ViaKoopman (22 files, −285)55cc5890— ViaL2 (BlockAverages, AlphaConvergence, etc.) (4 files, −90)6ed5220a— DeFinetti remaining (CesaroConvergence, ViaMartingale, etc.) (12 files, −265)e6f0de29— Ergodic + Util (6 files, −58)c4f32a14— PathSpace + Tail (4 files, −39)f0c7df73— Probability (partial) + revert broken KoopmanMeanErgodic (15 files, −104)Note on KoopmanMeanErgodic
autoGolf incorrectly replaced two proofs in
Ergodic/KoopmanMeanErgodic.leanwithassumption(which passed its internal check but failed duringlake build). Batch 6 reverts that file to its original state.Files still to process
The following 11 files in
Probability/were not reached by autoGolf (the run was stopped partway through):Probability/Martingale/Convergence.lean(may have been partially processed)Probability/Martingale/Crossings.leanProbability/Martingale/OrderDual.leanProbability/Martingale/Reverse.leanProbability/MartingaleExtras.leanProbability/MeasureKernels.leanProbability/SigmaAlgebraHelpers.leanProbability/TimeReversalCrossing.leanProbability/TripleLawDropInfo.leanProbability/TripleLawDropInfo/DropInfo.leanProbability/TripleLawDropInfo/PairLawHelpers.leanThe following files were processed but had 0 suggestions (no changes needed):
CesaroHelpers,CondExpBasic,CondExpHelpers,CondExpHelpers/AEComb,CondIndep,CondIndep/Basic,CondIndep/Bounded,ConditionalKernel,ConditionalKernel/CondExpKernel,ConditionalKernel/JointLawEq,Martingale,Bridge/CesaroToCondExp.Test plan
lake buildpasses on all 3296 modulessorrys introducedpropext,quot.sound,Classical.choice)